/*
 * @Author: dctxf
 * @Date:   2017-12-13 17:20:05
 * @Last Modified by:   dctxf
 * @Last Modified time: 2017-12-14 10:38:33
 */

module.exports = function flat(arr) {
  var result = [];
  for (let i = 0, len = arr.length; i < len; i++) {
    if (Array.isArray(arr[i])) {
      return result.concat(flat(arr[i]))
    } else {
      result.push(arr[i])
    }
  }
  return result
}